<template xmlns:v-bind="http://www.w3.org/1999/xhtml">
  <div class="sign-container">
    <a @click="toQianDao" class="sign-item qian-dao">
      <img v-bind:src="qData.picture">
    </a>
    <a @click="toChunJiang" class="sign-item chou-jiang">
      <img v-bind:src="cData.picture">
    </a>
  </div>
</template>
<script>
  //var LocalStorageUtil = require('./../../../commons/js/LocalStorageUtil');
  import {setItem} from './../../../commons/js/LocalStorageUtil'
  export default{
    data(){
      return {
        qData: '',
        cData:''
      }
    },
    watch:{
      activtys(curVal, oldVal){
          this.qData = this.activtys[0];
          this.cData = this.activtys[1];
      }
    },
    props: {
      activtys: {
        type: Array,
        default(){
          return [];
        }
      }
    },
    methods: {
      clickEvent(index){
        var userInfo = getItem("User");
        if (!userInfo || !userInfo.id){
          this.$router.go({path: '/login'})
          return;
        }
          this.urls[index] = this.activtys[index].linkUrl + "?userId=" + userInfo.id;
      },
      toQianDao(){
        var userInfo = getItem("User");
        if (!userInfo || !userInfo.id){
          this.$router.go({path: '/login'})
          return;
        }
        var url = this.activtys[0].linkUrl + "?userId=" + userInfo.id;
        $(".qian-dao").attr("href",url)
      },
      toChunJiang(){
        var userInfo = getItem("User");
        if (!userInfo || !userInfo.id){
          this.$router.go({path: '/login'})
          return;
        }
        var url = this.activtys[1].linkUrl + "?userId=" + userInfo.id;
        $(".chou-jiang").attr("href",url)
      }
    }
  }
</script>
<style>
  .sign-container {
    height: auto;
    width: 100%;
    background: white;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .sign-container .split-line {
    height: 99%;
    width: 0.1rem;
    background: #EEEEEE;
  }

  .sign-container .sign-item {
    height: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .sign-container .sign-item:active {
    background: #EEEEEE;
  }

  .sign-container .sign-item img {
    height: 100%;
    width: 100%;
  }


</style>
